//index.js
//获取应用实例
const db = wx.cloud.database()
const app = getApp()
Page({
  data: {
    button_text_date: {
      women_color: '#726e6e',
      man_color: '#000000',
      left: 463
    },
    main_imags_date: [{
      src: '/haibao/shouye-5.jpg',
      text: '通勤款式'
    }, {
      src: '/haibao/shouye-4.jpg',
      text: '系列新品'
    }],
    button_imags_date: [{
      src: '/haibao/shouye-6.jpg',
      text: '春季系列',
      subtext: '春季款式'
    }, {
      src: '/haibao/shouye-1.jpg',
      text: '夏季系列',
      subtext: '夏季款式'
    }, {
      src: '/haibao/shouye-5.jpg',
      text: '秋季款式',
      subtext: ''
    }, {
      src: '/haibao/shouye-8.jpg',
      text: '冬季款式',
      subtext: ''
    }],
    userInfo: {},
    search_head_top: 0,
    search_head_width: 0,
    head_title_height: 0,
    head_title_top: 0,
    statusBarHeight: app.statusBarHeight + 'px',
    navigationBarHeight: (app.statusBarHeight + 44) + 'px'
  },
  //事件处理
  bindButtonwomen: function () {
    this.setData({
      button_text_date: {
        women_color: '#000000',
        man_color: '#726e6e',
        left: 265
      },
      main_imags_date: [{
        src: '/haibao/shouye-5.jpg',
        text: '系列新品'
      }, {
        src: '/haibao/shouye-9.jpg',
        text: '职场款式'
      }]

    })
  },

  toGoodsList(e) {
    console.log('e', e)
    wx.navigateTo({
      url: `/pages/goods/index?id=${e.currentTarget.dataset.sex}`,
    })
  },

  toSearch() {
    wx.navigateTo({
      url: `/pages/search/search`,
    })
  },

  // 搜索跳转
  to_searchpage: function () {
    wx.navigateTo({
      url: '../search/search'
    })
  },
  bindButtonman: function () {
    this.setData({
      button_text_date: {
        women_color: '#726e6e',
        man_color: '#000000',
        left: 463
      },
      main_imags_date: [{
        src: '/haibao/shouye-5.jpg',
        text: '系列新品'
      }, {
        src: '/haibao/shouye-10.jpg',
        text: '职场款式'
      }]

    })
  },
  bindmore: function () {
    wx.navigateTo({
      url: '/pages/goods/index'
    })
  },
  listsp: function (e) {
    let lbname = e.currentTarget.dataset.lbname
    wx.navigateTo({
      url: '../listsp/index?lbname=' + lbname
    })
  },
  onLoad: function () {
    var that = this
    //头组件参数
    var head_title_height_tmp = app.globalData.menuButtonHeight * 0.78125
    var head_title_top_tmp = app.globalData.menuButtonHeight * 0.10938 + app.globalData.menuButtonTop
    var search_head_top_tmp = app.globalData.menuButtonHeight * 0.15625 + app.globalData.menuButtonTop
    //定位qiehuan组件参数
    that.setData({
      search_head_top: search_head_top_tmp + 'px',
      head_title_height: head_title_height_tmp + 'px',
      head_title_top: head_title_top_tmp + 'px'
    })
  }
})